Skip to content

fix(desktop): let a toast slide one way only, right - #4248

Merged
LHagfoss merged 2 commits into
mainfrom
fix/desktop-toast-swipe-one-way
Nov 22, 2026
Merged

LHagfoss merged 2 commits into
mainfrom
fix/desktop-toast-swipe-one-way

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

Before this change, a toast followed the pointer left, right and down, so dragging it wobbled diagonally. Now it slides one way only, right toward the window's edge:

  • Dragging left, up or down rubber-bands at a sixth of the distance and snaps back.
  • It dismisses past 48px right, or on a quick flick right (over 0.5 px/ms once it has moved at least 12px).
  • It always flies off the right edge.
  • Clicking, ×, Escape and the hover/focus pause work as before.

src/lib/toastDrag.ts holds the drag math, src/ui/Toaster.tsx passes the drag duration for the flick, and docs/design.md is updated to match.

Changelog

Toasts now swipe away to the right only, and a quick flick dismisses them.

Testing

  • bun run check in apps/desktop (includes the updated toastDrag unit tests).
  • In the mock, applied the real dragState output to a toast for a diagonal drag (left and down) and for a drag right: the diagonal drag now barely moves the card, and the drag right follows the pointer.

The card followed the pointer left, right and down, so a drag wobbled diagonally. It now slides right toward the window's edge, rubber-bands at a sixth any other way, and dismisses past 48px or on a quick flick right.
@github-actions github-actions Bot added the fix A bug fix label Nov 22, 2026
@LHagfoss
LHagfoss merged commit 0d399c1 into main Nov 22, 2026
8 checks passed
@LHagfoss
LHagfoss deleted the fix/desktop-toast-swipe-one-way branch November 22, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants